package group2assignone.dao;

import group2assignone.model.Person;
import group2assignone.view.ClientListView;
import java.util.ArrayList;

/**
 * interface provided for the client code.<br>
 * Incase different implementations are needed.
 * @author group2
 */
public interface ClientComms {

    /**
     * gets the current error and returns it as a string
     * @return
     */
    public String getErrorMsg();

    /**
     * Logs in the user (i.e) Sets up networking with the server and registers the customer.
     * @param p
     * @return (successful or not)
     */
    public boolean login(Person p);

    /**
     * When the user wants to Logout, informs server of logout and closes connection.
     */
    public void logout();

    /**
     * Starts a new thread for monitoring the view that lists the logged in users.
     * @param view
     */
    public void monitorClientView(ClientListView view);

    /**
     * Returns an arraylist of the currently logged in users
     * @return
     */
    public ArrayList<String> getClientList();
}
